{% load static %}
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{% block title %}{% endblock %} - 学时通</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
{#    <link rel="stylesheet" href="{% static 'vendor/bootstrap/css/bootstrap.min.css' %}">#}
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome CSS-->
{#    <link rel="stylesheet" href="{% static 'vendor/font-awesome/css/font-awesome.min.css' %}">#}
    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- Fontastic Custom icon font-->
    <link rel="stylesheet" href="{% static 'css/fontastic.css' %}">
    <!-- Google fonts - Poppins -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="{% static 'css/style.default.css' %}" id="theme-stylesheet">
    <!-- Favicon-->
    <link rel="shortcut icon" href="{% static 'img/favicon.ico' %}">
    <link rel="stylesheet" href="{% static 'css/custom.css' %}">
    {% block css %}

    {% endblock %}
    <!-- Tweaks for older IEs--><!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
  </head>
  <body>
    <div class="page">
      <!-- Main Navbar-->
      <header class="header">
        <nav class="navbar">
          <div class="container-fluid">
            <div class="navbar-holder d-flex align-items-center justify-content-between">
              <!-- Navbar Header-->
              <div class="navbar-header">
                <!-- Navbar Brand --><a href="{% url 'index' %}" class="navbar-brand d-none d-sm-inline-block">
                  <div class="brand-text d-none d-lg-inline-block"><span><strong>学时通</strong> </span>后台管理系统</div>
                  <div class="brand-text d-none d-sm-inline-block d-lg-none"><strong>BD</strong></div></a>
                <!-- Toggle Button-->
                <a id="toggle-btn" href="#" class="menu-btn active"><span></span><span></span><span></span></a>
              </div>
              <!-- Navbar Menu -->
              <ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">

               <!-- Logout    -->
                <li class="nav-item"><a class="nav-link logout" data-toggle="modal" data-target="#helpModal"> <span class="d-none d-sm-inline">查看帮助</span></a></li>
                <li class="nav-item"><a class="nav-link" href="{% url 'users:password_change' %}">修改密码</a></li>
                <li class="nav-item"><a href="{% url 'users:logout' %}" class="nav-link logout"> <span class="d-none d-sm-inline">退出登录</span><i class="fa fa-sign-out"></i></a></li>
              </ul>
            </div>
          </div>
        </nav>
      </header>
      <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalCenterTitle">学时通使用说明</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
              ...
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
            </div>
          </div>
        </div>
      </div>
      {% with role=request.user.role %}
      <div class="page-content d-flex align-items-stretch">
        <!-- Side Navbar -->
        <nav class="side-navbar">
          <!-- Sidebar Header-->
          <div class="sidebar-header d-flex align-items-center">
            <div class="avatar">
              <img src="{% static 'img/avatar.png' %}" alt="..." class="img-fluid rounded-circle">
            </div>
            <div class="title">
              <h1 class="h4">{{ request.user.name }}</h1>
              <p>{{ request.user.get_role_display }}</p>

{#              <p><a href="{% url 'users:update_profile' request.user.pk %}">修改资料</a></p>#}
            </div>
          </div>
          <!-- Sidebar Navidation Menus-->
          <span class="heading">学生管理</span>

          <ul class="list-unstyled">
            <li class="left-link index-page"><a href="{% url 'index' %}"> <i class="icon-home"></i>首页 </a></li>
            {% if role == 1 %}
              <li class="left-link academy-page"><a href="{% url 'academy' %}"> <i class="fa fa-database"></i>学院管理 </a></li>
              <li class="left-link grade-page"><a href="{% url 'grade' %}"> <i class="fa fa-cube"></i>年级管理 </a></li>
            {% endif %}
            <li class="left-link student-page" ><a href="{% url 'students:students' %}"> <i class="fa fa-users"></i>学生管理 </a></li>
            {% if role == 1 or role == 3 %}

              <li class="left-link credit-page"><a href="{% url 'students:student_credit' %}"> <i class="fa fa-wrench"></i>学时变更 </a></li>
            {% endif %}
              <li class="left-link log-page"><a href="{% url 'logs:list' %}"><i class="fa fa-play-circle-o"></i>操作记录</a></li>
          </ul>
            {% if role == 1 %}
              <span class="heading">系统管理</span>
              <ul>
              <li class="left-link register-page"><a href="{% url 'users:admin_apply' %}"> <i class="fa fa-edit"></i>注册审核 </a></li>
              <li class="left-link admin-page"><a href="{% url 'users:admins' %}"> <i class="fa fa-user-circle-o"></i>用户管理 </a></li>
              </ul>
            {% endif %}




          <span class="heading">活动管理</span>
          <ul>
            {% if role == 2 or role == 3 %}
              <li class="left-link activity-verify-page"><a href="{% url 'activities:activity_unverify' %}"> <i class="fa fa-bullhorn"></i>活动审批 </a></li>
            {% endif %}
            {% if role == 4 %}
            <li class="left-link activity-page" ><a href="{% url 'activities:activities' %}"> <i class="fa fa-pencil-square-o"></i>我的活动</a></li>
            {% endif %}
            {% if role == 1 %}
            <li class="left-link activity-all-page"><a href="{% url 'activities:activity_all' %}"> <i class="fa fa-bullhorn"></i>全部活动 </a></li>
            {% endif %}

          </ul>
          <span class="heading">统计模块</span>
          <ul>
            <li class="left-link" ><a href="#"> <i class="fa fa-bar-chart"></i>学时统计 </a></li>
          </ul>
        {% endwith %}
        </nav>
        <div class="content-inner">
          <!-- Page Header-->
          <header class="page-header">
            <div class="container-fluid">
              <h2 class="no-margin-bottom">{% block header_name %}

              {% endblock %}</h2>
            </div>
          </header>

          {% block bread %}

          {% endblock %}

          {% if messages %}
              {% for message in messages %}
                  <div id="messages" class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">
                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                      {{ message }}
                  </div>
              {% endfor %}
            {% endif %}
          {% block body %}

          {% endblock %}

          <!-- Page Footer-->
          <footer class="main-footer">
            <div class="container-fluid">
              <p class="text-center">广州商学院学时通后台管理系统</p>
            </div>
          </footer>
        </div>
      </div>
    </div>
    <!-- JavaScript files-->
{#    <script src={% static 'vendor/jquery/jquery.min.js' %}></script>#}
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
{#    <script src="{% static 'vendor/popper.js/umd/popper.min.js' %}"> </script>#}
    <script src="https://cdn.bootcss.com/popper.js/1.15.0/umd/popper.min.js"></script>
{#    <script src={% static 'vendor/bootstrap/js/bootstrap.min.js' %}></script>#}
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
{#    <script src={% static 'vendor/jquery.cookie/jquery.cookie.js' %}> </script>#}
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
{#    <script src={% static 'vendor/jquery-validation/jquery.validate.min.js' %}></script>#}
    <script src="https://cdn.bootcss.com/jquery-validate/1.17.0/jquery.validate.min.js"></script>
{#    <script src="{% static 'vendor/layer/layer.js' %}"></script>#}
{#    <script src={% static 'js/charts-home.js' %}></script>#}
    <!-- Main File-->
    <script src="{% static 'js/common.js' %}"></script>

    {% block js %}

    {% endblock %}
  </body>
</html>
